package com.vmove.childtrain.db.entity;

import android.os.Parcelable;
import android.provider.FontsContract;

import com.j256.ormlite.dao.ForeignCollection;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.ForeignCollectionField;
import com.j256.ormlite.table.DatabaseTable;

import java.io.Serializable;
import java.util.Collection;

/**
 * 程序表
 */
@DatabaseTable(tableName = "tb_program")
public class Program implements Serializable {

    //表中各个字段的名称
    public static final String COLUMNNAME_ID = "id";
    public static final String COLUMNNAME_NAME = "programName";
    public static final String COLUMNNAME_CATEGORY_ID = "categoryId";

    @DatabaseField(generatedId = true,columnName = COLUMNNAME_ID)
    private int id;

    @DatabaseField(columnName = COLUMNNAME_NAME)
    private String programName;

    //指令延时 ms
    @DatabaseField(defaultValue = "200")
    private int delay;

    @DatabaseField(columnName = COLUMNNAME_CATEGORY_ID)
    private int category;

    //灵敏度 红外触发阈值/1~10
    @DatabaseField(defaultValue = "3")
    private int hongwaiLMD;

    //灵敏度 振动触发阈值/1~10
    @DatabaseField(defaultValue = "3")
    private int paidaLMD;

    //亮度1~5
    @DatabaseField(defaultValue = "3")
    private int liangdu;

    /**
     *声音模式 1无声 2开始时响 3感应时响
     */
    @DatabaseField(defaultValue = "1")
    private int shengyinmode;

    /**
     * 灯闪动模式 1不闪 2开始时闪 3一直闪
     */
    @DatabaseField(defaultValue = "1")
    private int shandengmode;

    /**
     * 触发模式0不触发 1红外，2拍打，3都触发
     */
    @DatabaseField(defaultValue = "0")
    private int chufamode;

    //触发后颜色
    @DatabaseField(defaultValue = "0")
    private int colorAfterCF;

    //触发后颜色延时
    @DatabaseField(defaultValue = "0")
    private int timeAfterCF;

    //超时后颜色
    @DatabaseField(defaultValue = "0")
    private int colorAfterCS;

    //超时后颜色延时
    @DatabaseField(defaultValue = "0")
    private int timeAfterCS;

    //亮灯持续时间  默认0xff永不超时
    @DatabaseField(defaultValue = "255")
    private int time;

    //亮灯颜色
    @DatabaseField(defaultValue = "0")
    private int color;

    //显示数字 默认0  0xff为不显示
    @DatabaseField(defaultValue = "0")
    private int number;

    //步骤数
    @DatabaseField(defaultValue = "0")
    private int stepNum;

    @DatabaseField(defaultValue = "1")
    private int targetLightNum;

    /**
     * 分钟
     */
    @DatabaseField(defaultValue = "1")
    private int runTime;


    public int getStepNum() {
        return stepNum;
    }

    public void setStepNum(int stepNum) {
        this.stepNum = stepNum;
    }

    public int getTargetLightNum() {
        return targetLightNum;
    }

    public void setTargetLightNum(int targetLightNum) {
        this.targetLightNum = targetLightNum;
    }

    public int getRunTime() {
        return runTime;
    }

    public void setRunTime(int runTime) {
        this.runTime = runTime;
    }

    @ForeignCollectionField
    private ForeignCollection<Record> records;

    public Program() {
    }

    public Program(int programId) {
        this.id = programId;
    }

    public int getCategory() {
        return category;
    }

    public void setCategory(int category) {
        this.category = category;
    }

    public ForeignCollection<Record> getRecords() {
        return records;
    }

    public void setRecords(ForeignCollection<Record> records) {
        this.records =  records;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProgramName() {
        return programName;
    }

    public void setProgramName(String programName) {
        this.programName = programName;
    }

    public int getDelay() {
        return delay;
    }

    public void setDelay(int delay) {
        this.delay = delay;
    }

    public int getHongwaiLMD() {
        return hongwaiLMD;
    }

    public void setHongwaiLMD(int hongwaiLMD) {
        this.hongwaiLMD = hongwaiLMD;
    }

    public int getPaidaLMD() {
        return paidaLMD;
    }

    public void setPaidaLMD(int paidaLMD) {
        this.paidaLMD = paidaLMD;
    }

    public int getLiangdu() {
        return liangdu;
    }

    public void setLiangdu(int liangdu) {
        this.liangdu = liangdu;
    }

    public int getShengyinmode() {
        return shengyinmode;
    }

    public void setShengyinmode(int shengyinmode) {
        this.shengyinmode = shengyinmode;
    }

    public int getShandengmode() {
        return shandengmode;
    }

    public void setShandengmode(int shandengmode) {
        this.shandengmode = shandengmode;
    }

    public int getChufamode() {
        return chufamode;
    }

    public void setChufamode(int chufamode) {
        this.chufamode = chufamode;
    }

    public int getColorAfterCF() {
        return colorAfterCF;
    }

    public void setColorAfterCF(int colorAfterCF) {
        this.colorAfterCF = colorAfterCF;
    }

    public int getTimeAfterCF() {
        return timeAfterCF;
    }

    public void setTimeAfterCF(int timeAfterCF) {
        this.timeAfterCF = timeAfterCF;
    }

    public int getColorAfterCS() {
        return colorAfterCS;
    }

    public void setColorAfterCS(int colorAfterCS) {
        this.colorAfterCS = colorAfterCS;
    }

    public int getTimeAfterCS() {
        return timeAfterCS;
    }

    public void setTimeAfterCS(int timeAfterCS) {
        this.timeAfterCS = timeAfterCS;
    }

    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "Program{" +
                "id=" + id +
                ", programName='" + programName + '\'' +
                ", delay=" + delay +
                '}';
    }
}
